with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Util; use Util;

package Generateur_Xml is

	type Noeud is private;
	type Ptr_Noeud is private;

	function Creer_Noeud (Nom : String) return Ptr_Noeud;
	function Creer_Noeud (Nom : String; Valeur : String) return Ptr_Noeud;
	function Creer_Noeud (Nom : String; Valeur : Integer) return Ptr_Noeud;

	procedure Associer (Pere : in out Ptr_Noeud; Fils : in Ptr_Noeud);
	
	procedure Ajouter_Attribut (N : in out Ptr_Noeud; Nom : in String; Valeur : in String);
    procedure Ajouter_Attribut (N : in out Ptr_Noeud; Nom : in String; Valeur : in Character);
    procedure Ajouter_Attribut (N : in out Ptr_Noeud; Nom : in String; Valeur : in Integer);

	function To_Xml (N : Ptr_Noeud) return String;

private

	type Attribut;
	type Ptr_Attribut is access Attribut;
	
	type Attribut is
	record
		Nom : Unbounded_String;
		Valeur : Unbounded_String;
		Frere : Ptr_Attribut;
	end record;

	type Ptr_Noeud is access Noeud;

	type Noeud is
	record
		Nom : Unbounded_String;
		Valeur : Unbounded_String;
		Frere : Ptr_Noeud;
		Fils : Ptr_Noeud;
		Attribut : Ptr_Attribut;
	end record;
	
	function To_Xml (A : Ptr_Attribut) return Unbounded_String;
end Generateur_Xml;